package service.impl;

import dao.ElectrocarDao;
import dao.impl.ElectrocarDaoImpl;
import entity.Powerbattery;
import service.ElectrocarService;

import java.util.List;

public class ElectrocarServiceImpl implements ElectrocarService {
    ElectrocarDao electrocarDao = new ElectrocarDaoImpl();
    //修改
    @Override
    public int update(Powerbattery powerbattery) {
        return electrocarDao.update(powerbattery);
    }

    //详细
    @Override
    public Powerbattery detail(int id) {
        return electrocarDao.detail(id);
    }

    //查询全部
    @Override
    public List<Powerbattery> SelectAll() {
        return electrocarDao.SelectAll();
    }

    //删除
    @Override
    public boolean delete(int id) {
        if (electrocarDao.delete(id)>0){
            return true;
        }else{
            return false;
        }
    }
}
